// 导入路由
import {
  BrowserRouter as Router,
  Route,
  Switch,
  Redirect,
} from 'react-router-dom'
import './App.scss'
// 导入页面文件
import Login from '@/pages/Login/index'
import Layout from '@/pages/Layout/index'
// 配置路由规则
function App() {
  return (
    <Router>
      <div className='App'>
        <Switch>
          {/* 重定向,精确匹配 */}
          <Route path='/' exact render={() => <Redirect to='/home' />}></Route>
          <Route path='/home' component={Layout}></Route>
          <Route path='/login' component={Login}></Route>
        </Switch>
      </div>
    </Router>
  )
}

export default App
